$(function () {
    // 配置路径
    var pageUrl = config.urlAnaConfig.testPath;
    var PathLoginUrl = config.urlAnaConfig.PathLogin;
    // 获取Cookie
    function getCookie(name){
        var strcookie = document.cookie;//获取cookie字符串
        var arrcookie = strcookie.split("; ");//分割
    //       console.log(arrcookie);
        //遍历匹配
        for ( var i = 0; i < arrcookie.length; i++) {
            var arr = arrcookie[i].split("=");
                if (arr[0] ==name){
                    return arr[1];
                }
        }
        return "";
    }
    var name = "tokenval";
    // tiken值
    var cookie_value = getCookie(name);
    console.log(cookie_value);
    var name1 = "userName";
    // 用户名值
    var cookie_value1 = getCookie(name1);
    $(".userName").html(cookie_value1);
    $(".nav-usename").html(cookie_value1);
    /*选货*/


    // 多选
    // 下拉数据
    $('#usertype').selectpicker({
            noneSelectedText : '请选择',
     });
     
    // 下拉数据
    $.ajax({
        url: pageUrl+'/api/productproperty/getplatforms',
        type: 'POST',
        dataType: 'json',
        headers: {
            Authorization: 'Bearer '+cookie_value
        },
        success: function (data) {
            var msg = '';
            if (data) {
                if (data.code === 200) {
    //                  店铺名称
                    var details1 = data.data.channels;
                    var details1F = $(".details1").next('ul');
                    var mydetails1 = details1;
                    /*for in 循环*/
                     for(var i in mydetails1){
                         var text="<li>" + mydetails1[i] + " </li>";
                         details1F.append(text);
                     };
                }
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

    });
    $('.det_det').on('click','li',function(){
        $(".storeName").attr("disabled",false).removeClass("border-hui");
        $(".details0 option:gt(0)").remove();
        $(".details2 option:gt(0)").remove();
        $(".details3 option:gt(0)").remove();
        $(".details4 option:gt(0)").remove();
        $(".details5 option:gt(0)").remove();
        $(".details2").attr("disabled",false);
        $(".details0").attr("disabled",true);
        $(".details3").attr("disabled",true);
        $(".details4").attr("disabled",true);
        $(".details5").attr("disabled",true);
        $(".application ").removeClass("querenguo").attr("disabled",true);
        var details1D= $(this).html();
        console.log(details1D);
        $.ajax({
            url: pageUrl+'/api/productproperty/getstoresbyplatform',
            type: 'POST',
            dataType: 'json',
            data:{
                platform:details1D
            },
            headers: {
                Authorization: 'Bearer '+cookie_value
            },
            success: function (data) {
                var msg = '';
                if (data) {
                    if (data.code === 200) {
        //                  店铺名称
                        $(".det_det2 li").remove();
                        var details2 = data.data.stores;
                        var details2F = $(".details2").next('ul');
                        var mydetails2 = details2;
                        /*for in 循环*/
                         for(var i in mydetails2){
                             var text="<li>"+mydetails2[i]+"</li>";
                             details2F.append(text);
                         };

                    }
                }
            },
            error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

        });
    });
    $('.det_det2').on('click','li',function(){
        $(".storeName").attr("disabled",false).removeClass("border-hui");
        $(".details0 option:gt(0)").remove();
        $(".details3 option:gt(0)").remove();
       $(".details4 option:gt(0)").remove();
       $(".details5 option:gt(0)").remove();
        $(".details3").attr("disabled",false);
        $(".details0").attr("disabled",true);
        $(".details4").attr("disabled",true);
        $(".details5").attr("disabled",true);
        $(".application ").removeClass("querenguo").attr("disabled",true);
        var details1D1 = $(".details1").val();
        var details2D2 = $(".details2").val();
        console.log(details1D1+details2D2)
        $.ajax({
           url: pageUrl+'/api/productproperty/getactivitysbyplatformandstoreandyears',
           type: 'POST',
           dataType: 'json',
           data:{
               platform:details1D1,
               store:details2D2,
               year:''
           },
           headers: {
               Authorization: 'Bearer '+cookie_value
           },
           success: function (data) {
               var msg = '';
               if (data) {
                   if (data.code === 200) {
       //                  店铺名称
                       console.log(data)
                    var details3 = data.data.activitys;
                    console.log(details3);
                    var details3F = $('#usertype');
                    /*for in 循环*/
                     for(var i in details3){
                         var ss="<option value='" + details3[i].rank + "'>" + details3[i].name + "</option>";
                    
                        details3F.append(ss)
                        $('#usertype').selectpicker('refresh');
                     };
                       
                   }
               }
           },
           error:  function (XMLHttpRequest, textStatus, errorThrown) {
                   // msg
                   var errorTips = XMLHttpRequest.responseJSON.msg;
                   if (errorTips=='Division by zero'){
                       $(".layer1 .content").html("数据错误");
                       $(".layer1").show();
                       console.log(errorTips);
                   } else if(errorTips=='Token has expired'){
                       $(".layer1 .content").html("令牌过期");
                       $(".layer1").show();
                       window.location.href="login.html";
                   }


               }

       });

    })
    // $(".details2").change(function () {
      
    //  });
    $("#usertype").change(function () {
        $(".storeName2").attr("disabled",false).removeClass("border-hui");
         $(".details0 option:gt(0)").remove();
         $(".details4 option:gt(0)").remove();
         $(".details5 option:gt(0)").remove();
         $(".details0").attr("disabled",false);
         $(".details4").attr("disabled",false);
         $(".details5").attr("disabled",false);
         $(".application ").addClass("querenguo").attr("disabled",false);
         var details1D1 = $(".details1 option:selected").val();
         var details3Data = $(".filter-option").html();
         // console.log(details3Data);
         $.ajax({
            url: pageUrl+'/api/productproperty/getseasons',
            type: 'POST',
            dataType: 'json',
            data:{
                platform:details1D1,
                activity:details3Data,
                year:''
            },
            headers: {
                Authorization: 'Bearer '+cookie_value
            },
            success: function (data) {
                var msg = '';
                if (data) {
                    if (data.code === 200) {
        //                  店铺名称
                        $(".details0 li").remove();
                        var details0 = data.data.seasons;
                        var details0F = $(".details0");
                        /*for in 循环*/
                         for(var i in details0){
                             var text="<li>"+details0[i]+"</li>";
                             details0F.append(text);
                         };

                    }
                }
            },
            error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

        });
         $.ajax({
            url: pageUrl+'/api/productproperty/getproductproperty1',
            type: 'POST',
            dataType: 'json',
            data:{
                platform:details1D1,
                activity:details3Data,
                year:''
            },
            headers: {
                Authorization: 'Bearer '+cookie_value
            },
            success: function (data) {
                var msg = '';
                if (data) {
                    if (data.code === 200) {
        //                  店铺名称
                        $(".details4 li").remove();
                        var details4 = data.data.divisions;
                        // console.log(details4);
                        var details4F = $(".details4");
                        /*for in 循环*/
                         for(var i in details4){
                             var text="<li>"+details4[i]+"</li >";
                             details4F.append(text);
                         };

                    }
                }
            },
            error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

        });
         $.ajax({
            url: pageUrl+'/api/productproperty/getproductproperty2',
            type: 'POST',
            dataType: 'json',
            data:{
                platform:details1D1,
                activity:details3Data,
                year:''
            },
            headers: {
                Authorization: 'Bearer '+cookie_value
            },
            success: function (data) {
                var msg = '';
                if (data) {
                    if (data.code === 200) {
        //                  店铺名称
                        $(".details5 li").remove();
                        var details5 = data.data.lines;
                        var details5F = $(".details5");
                        /*for in 循环*/
                         for(var i in details5){
                             var text="<li>"+details5[i]+"</li>";
                             details5F.append(text);
                         };

                    }
                }
            },
            error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }

        });
     });

    // 图
    $.ajax({
        url: pageUrl+'/api/common/getaccesstoken',
        type: 'POST',
        dataType: 'json',
        success: function (data) {
            var msg = '';
            if (data) {
                var accessToken = data.data.accessToken.value;
           
                console.log(accessToken);
                var embedUrl = "https://app.powerbi.cn/reportEmbed?reportId=bfd4a206-1631-4cdd-8ee3-0ea70a37e710&groupId=ccc12464-fcfc-4fd0-ac4b-877eaad6b69b&pageName=ReportSection";
                tubiao1(accessToken,embedUrl);
            }
        },
        error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("数据错误");
                        $(".layer1").show();
                        // console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }
    });
    function tubiao1(accessToken,embedUrl) {
        // Read embed application token from Model
        // var accessToken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IkZDQmFtTFdha2tLWVhTMFFEdDJYcVFha2JPRSIsImtpZCI6IkZDQmFtTFdha2tLWVhTMFFEdDJYcVFha2JPRSJ9.eyJhdWQiOiJodHRwczovL2FuYWx5c2lzLmNoaW5hY2xvdWRhcGkuY24vcG93ZXJiaS9hcGkiLCJpc3MiOiJodHRwczovL3N0cy5jaGluYWNsb3VkYXBpLmNuLzlhZWJiZmVkLTc1MmMtNDVhYy1iZDhiLTg2ODczODZiYjg0ZS8iLCJpYXQiOjE1NTIzODMzNzUsIm5iZiI6MTU1MjM4MzM3NSwiZXhwIjoxNTUyMzg3Mjc1LCJhY2N0IjowLCJhY3IiOiIxIiwiYWlvIjoiWTJKZ1lIQXNFVmNSelR1M0tsUm1ybGJ3REczWmZWb0tEK1FXN2EyY05Vdnd0dnNXazdVQSIsImFtciI6WyJwd2QiXSwiYXBwaWQiOiJmNDRlNTg4Zi1iZDUwLTRhNmYtOGI4Mi0wZjU1ZjU0MTk1MGYiLCJhcHBpZGFjciI6IjAiLCJmYW1pbHlfbmFtZSI6Ium7hCIsImdpdmVuX25hbWUiOiLlrZDmgboiLCJpcGFkZHIiOiI1OC4zNy4yOC4xMSIsIm5hbWUiOiLpu4TlrZDmgboiLCJvaWQiOiJlNjBmOWU4MS1iZmJlLTQ4NDUtYThmMi1mNDUzNGVhYmM3MGYiLCJwdWlkIjoiMjAwM0JGRkQ4MTZFRkVEQyIsInNjcCI6IkFwcC5SZWFkLkFsbCBDYXBhY2l0eS5SZWFkLkFsbCBDYXBhY2l0eS5SZWFkV3JpdGUuQWxsIENvbnRlbnQuQ3JlYXRlIERhc2hib2FyZC5SZWFkLkFsbCBEYXNoYm9hcmQuUmVhZFdyaXRlLkFsbCBEYXRhLkFsdGVyX0FueSBEYXRhc2V0LlJlYWQuQWxsIERhdGFzZXQuUmVhZFdyaXRlLkFsbCBHYXRld2F5LlJlYWQuQWxsIEdhdGV3YXkuUmVhZFdyaXRlLkFsbCBHcm91cC5SZWFkIEdyb3VwLlJlYWQuQWxsIE1ldGFkYXRhLlZpZXdfQW55IFJlcG9ydC5SZWFkLkFsbCBSZXBvcnQuUmVhZFdyaXRlLkFsbCBUZW5hbnQuUmVhZC5BbGwgVGVuYW50LlJlYWRXcml0ZS5BbGwgV29ya3NwYWNlLlJlYWQuQWxsIFdvcmtzcGFjZS5SZWFkV3JpdGUuQWxsIiwic3ViIjoiMlJOaXFuSDVENXhzX1h3ZUI2YUhKc3hJM2twQ3lBZ0hGZmVjQkZ5a2swdyIsInRpZCI6IjlhZWJiZmVkLTc1MmMtNDVhYy1iZDhiLTg2ODczODZiYjg0ZSIsInVuaXF1ZV9uYW1lIjoiemlrYWlAc2FwenoucGFydG5lci5vbm1zY2hpbmEuY24iLCJ1cG4iOiJ6aWthaUBzYXB6ei5wYXJ0bmVyLm9ubXNjaGluYS5jbiIsInV0aSI6IktkTnQ0QTNTOGtxUzdEbjhwWG9QQUEiLCJ2ZXIiOiIxLjAiLCJ3aWRzIjpbIjYyZTkwMzk0LTY5ZjUtNDIzNy05MTkwLTAxMjE3NzE0NWUxMCJdfQ.Zq2JiRACWawYqWOBifKCxDUlU3Ea6dkasXu7waG2aWmEiERb7qC2-pPF_ljIa5MG0wVFtC9XV8s-780ADpslMXzTOjUcWczpQLChNLTJ2-mK4J0uXpeHUdKflX2hg-jaAxttMSVdnwlg0W9PiBT2dBNba_BKHada9GyjQohXd4W1vlw7mir3lEMOwza45v6qOpEknZaJjC2qmHd7nAhiF9TJdYVL6uzq7iR3osCmymiNDhOj1Tx7grH2kbp0lxpav12Ui-YCyhoV_t7SmTdJvpoqm3SmpQHdjnQ9r1Y60lCS2KlzVmp6P9M_5oyi5ZqDJ3VspwNT_888zfI75XTojA";
        // Read embed URL from Model
        accessToken = accessToken;
        // var embedUrl = "https://app.powerbi.cn/reportEmbed?reportId=bfd4a206-1631-4cdd-8ee3-0ea70a37e710&groupId=ccc12464-fcfc-4fd0-ac4b-877eaad6b69b&pageName=ReportSection";
        // Read report Id from Model
        embedUrl = embedUrl;
        console.log(embedUrl);
        var embedReportId = "c518045e-c439-4f43-b89a-f2f944526b19";
        // Get models. models contains enums that can be used.
        var models = window['powerbi-client'].models;
        // Embed configuration used to describe the what and how to embed.
        // This object is used when calling powerbi.embed.
        // This also includes settings and options such as filters.
        // You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
        var config = {
            type: 'report',
            // tokenType: models.TokenType.Embed,
            accessToken: accessToken,
            embedUrl: embedUrl,
            id: embedReportId,
            viewMode: models.ViewMode.View,
            // filters: filter,
            permissions: models.Permissions.All ,
            settings: {
                filterPaneEnabled: false,
                navContentPaneEnabled: false
            }
        };
        // Get a reference to the embedded report HTML element
        var tu11 = $('.tu11')[0];
        if ("" != "") {
            $("#RLS").prop('checked', true);
            $("#RLSdiv").show();
        }
        else
        {
            $("#RLS").prop('checked', false);
            $("#RLSdiv").hide();
        }
        if ("False" == "True") {
            $("#noRLSdiv").hide();
            $("#RLS").removeAttr("disabled");
            $("#RLS").change(function () {
                if ($(this).is(":checked")) {
                    $("#RLSdiv").show(300);
                } else {
                    $("#RLSdiv").hide(200);
                }
            });
        }
        else
        {
            $("#noRLSdiv").show();
        }
        var report = powerbi.embed(tu11, config);
    }

    // 图形重置
    var pingjieIndex1 = 0;
    $(".application").on("click",function () {
        var details1Data = $(".details1").val();
        var details2Data = $(".details2").val();
        var details3Data = $(".filter-option").html();
        details3Data = details3Data.replace(/\s*/g,"");
        var details0Data = $(".details0").prevAll("input").val();
        var details4Data = $(".details4").prevAll("input").val();
        var details5Data = $(".details5").prevAll("input").val();
        if (details1Data == 0 || details2Data==0 || details3Data=="请选择"){
            alert("请选择完整选项");
            return false;
        };
        // 拼接图形盒子1
        pingjieIndex1++;
        var tu1Id = "reportContainer1";
        tu1Id = tu1Id + pingjieIndex1;
        // console.log(tu1Id);
        var arrtx1 = [];
        arrtx1.push("<div class='tu11 no-border'" + "id=" +tu1Id +">");
        arrtx1.push("</div>");
        str0 = arrtx1.join('');
        $(".tu1").append(str0);
        // 删除其他元素
        $('.tu1'+' #'+tu1Id).siblings().remove();
        // console.log(details3Data);
        details3Data=details3Data.split(',');
        var arr = [];
        for (i=0;i<details3Data.length ;i++ ){
            var text = "'"+details3Data[i]+"'";
            arr.push(text);
        }
        var result = "("+arr+")";
        // console.log(result);
        var dXactivitysUrl = "&filter=activity/activity_name";
        if(arr.length==1){
            dXactivitysUrl = dXactivitysUrl+" eq '"+details3Data+"'";
        } else if (arr.length>1){
            dXactivitysUrl = dXactivitysUrl+" in "+result;
        }

        if (details0Data == 0 || details0Data=="全部"){
            details0Data ='';
        };
        if (details4Data == 0 || details4Data=="全部"){
            details4Data ='';
        };
        if (details5Data == 0 || details5Data=="全部"){
            details5Data ='';
        };
        var embedUrl = "https://app.powerbi.cn/reportEmbed?reportId=bfd4a206-1631-4cdd-8ee3-0ea70a37e710&groupId=ccc12464-fcfc-4fd0-ac4b-877eaad6b69b&pageName=ReportSection";
        // 都为空a
        if (details0Data == '' && details4Data == '' && details5Data ==''){
            embedUrl = embedUrl+dXactivitysUrl;
        // 都不为空a
        } else if(details0Data !== '' && details4Data !== '' && details5Data !== ''){
            embedUrl = embedUrl+dXactivitysUrl+" and prod_activity_general/prod_season eq"+" '"+details0Data+"'"+" and prod_activity_general/division eq"+" '"+details4Data+"'"+" and prod_activity_general/line eq"+" '"+details5Data+"'";
        // 除了季节都为空
        } else if(details0Data !== '' && details4Data == '' && details5Data == ''){
            embedUrl = embedUrl+dXactivitysUrl+" and prod_activity_general/prod_season eq"+" '"+details0Data+"'";
        // 除了商品属性1都为空
        } else if(details0Data == '' && details4Data !== '' && details5Data == ''){
            embedUrl = embedUrl+dXactivitysUrl+" and prod_activity_general/division eq"+" '"+details4Data+"'";
        // 除了商品属性2都为空
        } else if(details0Data == '' && details4Data == '' && details5Data !== ''){
            embedUrl = embedUrl+dXactivitysUrl+" and prod_activity_general/line eq"+" '"+details5Data+"'";
        // 只有季节为空
        } else if(details0Data == '' && details4Data !== '' && details5Data !== ''){
            embedUrl = embedUrl+dXactivitysUrl+ "and prod_activity_general/division eq"+" '"+details4Data+"'"+" and prod_activity_general/line eq"+" '"+details5Data+"'";
        // 只有商品属性1为空
        } else if(details0Data !== '' && details4Data == '' && details5Data !== ''){
            embedUrl = embedUrl+dXactivitysUrl+" and prod_activity_general/prod_season eq"+" '"+details0Data+"'"+" and prod_activity_general/line eq"+" '"+details5Data+"'";
        // 只有商品属性2为空
        } else if(details0Data !== '' && details4Data !== '' && details5Data == ''){
            embedUrl = embedUrl+dXactivitysUrl+" and prod_activity_general/prod_season eq"+" '"+details0Data+"'"+" and prod_activity_general/division eq"+" '"+details4Data+"'";

        }
        $.ajax({
            url: pageUrl+'/api/common/getaccesstoken',
            type: 'POST',
            dataType: 'json',
            success: function (data) {
                var msg = '';
                if (data) {
                    var accessToken = data.data.accessToken.value;
                    tubiao1(accessToken,embedUrl);
                }
            },
            error:  function (XMLHttpRequest, textStatus, errorThrown) {
                    // msg
                    var errorTips = XMLHttpRequest.responseJSON.msg;
                    if (errorTips=='Division by zero'){
                        $(".layer1 .content").html("数据错误");
                        $(".layer1").show();
                        console.log(errorTips);
                    } else if(errorTips=='Token has expired'){
                        $(".layer1 .content").html("令牌过期");
                        $(".layer1").show();
                        window.location.href="login.html";
                    }


                }
        });
    });

    // 下载
    $(".download-btn").on("click",function () {
        var details1Data = $(".details1").val();
        var details2Data = $(".details2").val();
        var details3Data = $(".filter-option").html();
        details3Data = details3Data.replace(/\s*/g,"");
        console.log(details3Data);
        var details0Data = $(".details0").val();
        var details4Data = $(".details4").val();
        var details5Data = $(".details5").val();
        var details0U = "&season=";
        if (details0Data == 0){
            details0U = ''
        } else {
            details0U = "&season="+details0Data;
        }
        var details4U = "&season=";
        if (details4Data == 0){
            details4U = ''
        } else {
            details4U = "&division="+details4Data;
        }
        var details5U = "&season=";
        if (details5Data == 0){
            details5U = ''
        } else {
            details5U = "&line="+details0Data;
        }
        if (details1Data == 0 || details2Data==0 || details3Data=="请选择"){
            alert("请选择完整选项");
            return false;
        };
        details3Data=details3Data.split(',');
        var arr = [];
        console.log(details3Data.length)
       /* if (details3Data.length>1){

        }else if(details3Data.length==1){
            result = details3Data;
        }*/
        for (i=0;i<details3Data.length ;i++ ){
            var text = "'"+details3Data[i]+"'";
            arr.push(text);
        }
        var result = arr;
        console.log(result);
        var dlUrl = pageUrl+"/api/productproperty/exportexceldata"+"?platform="+details1Data+"&store="+details2Data+"&activity="+result+details0U+details4U+details5U;
        console.log(dlUrl);
        window.location.href=dlUrl;
    /*    var formData = new FormData($('#uploadForm')[0]);
         console.log(formData);
         formData.append('data', fileData);
         formData.append('platform', platformV);
         formData.append('store', storeV);
         formData.append('date', timeV);
         console.log(formData);*/
  /*       $.ajax({
            url: pageUrl+'/api/common/exporttest',
            type: 'POST',
            cache: false,
   /!*         data: formData,*!/
            processData: false,
            contentType: false
         }).done(function(res) {
             console.log("下载成功");
         }).fail(function(res) {
            console.log("下载失败");
         });*/

    });

});